#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int INF=0x3f3f3f3f;
void solve()
{
	int n;
	cin>>n;
	if(n%3==0)
	{
		cout<<n/3<<' '<<n/3+1<<' '<<n/3-1;
	}
	else if(n%3==1)
	{
		cout<<n/3<<' '<<n/3+2<<' '<<n/3-1;
	}
	else if(n%3==2)
	{
		cout<<n/3+1<<' '<<n/3+2<<' '<<n/3-1;
	}
	cout<<endl;
}
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		solve();
	}

	return 0;
}

